<template>
  <div>
    <div class="head">
      <text class="font" :style="{ fontFamily: 'wxcIconFont' }" @click="goBack()">{{'\ue689'}}</text>
      <text class="font tab" @click="tabTo('projectDisMap')" :class="[this.isActive('projectDisMap')]">工程分布图</text>
      <text class="font tab" @click="tabTo('projectDisGrid')" :class="[this.isActive('projectDisGrid')]">工程分布表</text>
    </div>
    <div class="content">
      <router-view/>
    </div>
  </div>
</template>

<script>
import { addIconFontSupport } from '@/config/IconConfig'

const dom = weex.requireModule('dom')
const modal = weex.requireModule('modal')

export default {
  name: 'projectDistribution',
  created () {
    addIconFontSupport(dom, "../../")
  },
  data () {
    return {
      pIndexKey:'projectDisMap'
    }
  },
  methods: {
    isActive (_c) {
      return this.pIndexKey === _c ?'tab-active':''
    },
    tabTo (_key) {
      if(this.pIndexKey === _key) return;
      this.pIndexKey = _key;
      this.jumpInter(_key)
    },
    goBack () {
      this.toBack()
    }
  }
}
</script>

<style lang="scss" scoped>
  @import '../../config/styles.scss';

  .head {
    @include header();
  }
  .font {
    color: $--theme-color;
    font-size: 42px;
    padding: 10px;
  }
  .tab {
    margin-left: 60px;
    border-bottom-width: 0;
    border-bottom-color: $--theme-color;
    border-bottom-style: solid;
  }
  .tab-active {
    border-bottom-width: 4px;
  }
  .content {
    flex: 1;
  }
</style>
